package com.ty.skysystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ty.common.validator.group.SaveGroup;
import com.ty.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 车辆信息表: 用于存放和管理车辆信息 字段列: team_id => 对应表: truck_team
 *
 * @author tianyuzhu
 * @email 1659770218@QQ.COM
 * @date 2020-12-11 15:30:43
 */
@Data
@TableName("truck")
@ApiModel(value = "车辆信息实体类")
public class TruckEntity implements Serializable {
  private static final long serialVersionUID = 1L;

  /** 车辆编号(自增) */
  @Null(
      message = "新增时不能携带车辆ID",
      groups = {SaveGroup.class})
  @NotNull(
      message = "修改时车辆ID不能为空",
      groups = {UpdateGroup.class})
  @TableId(value = "truck_id", type = IdType.AUTO)
  @ApiModelProperty(value = "车辆ID-主键")
  private Long truckId;
  /** 车牌号码 */
  @NotBlank(
      message = "车牌号码不能为空",
      groups = {SaveGroup.class})
  @ApiModelProperty(value = "车牌号码")
  private String number;
  /** 购车日期 */
  @NotNull(
      message = "购车日期不能为空",
      groups = {SaveGroup.class})
  @ApiModelProperty(value = "购车时间")
  private Date buyDate;
  /** 车辆类型 */
  @NotBlank(
      message = "车辆类型不能为空",
      groups = {SaveGroup.class})
  @ApiModelProperty(value = "车辆类型")
  private String type;
  /** 加入车队时间 */
  @NotNull(
      message = "加入车队时间不能为空",
      groups = {SaveGroup.class})
  @ApiModelProperty(value = "加入车队时间")
  private Date participateTime;
  /** 吨位 */
  @NotNull(
      message = "吨位不能为空",
      groups = {SaveGroup.class})
  @ApiModelProperty(value = "吨位")
  private Integer tonnage;
  /** 所属车队编号(对应车队信息表) */
  @ApiModelProperty(value = "所属车队编号(对应车队信息表)")
  private Long teamId;
  /** 工作状态 : 1:承运中 2:空闲 */
  @Range(
      min = 1,
      max = 2,
      message = "工作状态必须为1或2",
      groups = {SaveGroup.class, UpdateGroup.class})
  @ApiModelProperty(value = "工作状态: 1: 承运中, 2: 空闲")
  private Integer state;
  /** 备注 */
  @ApiModelProperty(value = "备注")
  private String remark;
  /** 1 表示删除， 0 表示未删除 */
  @TableLogic
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @ApiModelProperty(value = "逻辑删除: 1: 表示删除, 0: 表示未删除")
  private Integer isDeleted;
  /** 创建时间 */
  @ApiModelProperty(value = "创建时间")
  private Date createTime;
  /** 修改时间 */
  @ApiModelProperty(value = "修改时间")
  private Date updateTime;
}
